<!--06-数组.html-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06-数组</title>
    <script type="text/javascript">

        // 定义一个空数组
        var arr = [];
        console.log("arr.lenght:" + arr.length)  // 0

        arr[0] = 10;
        console.log("arr[0]:" + arr[0]);      // 10
        console.log("arr.length" + arr.length);  // 1  自动扩容

        arr[2] = true;
        console.log(arr[1]);      // undefined
        console.log(arr.length);  // 3  自动扩容

        console.log("#1 test");
        for (let i = 0; i < arr.length; i++) {
            console.log(arr[i]);
        }

    </script>
</head>
<body>
</body>
</html>